<!DOCTYPE html>
<!--/*
    Copyright 2016-2019 Jasha Joachimsthal

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
  */-->

<html lang="en" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      xmlns:with="http://www.thymeleaf.org/extras/with"
      layout:decorate="~{layout}"
      with:title="Edit">
<th:block layout:fragment="content">
    <div class="row">
        <div class="col-md-6">

            <!--/* only th:fragment form is returned for an XMLHttpRequest */-->
            <th:block th:fragment="form">
                <form th:action="@{|/cities/${city.id}|}" th:object="${city}" method="post">
                    <div class="form-group">
                        <label class="control-label" th:for="name">Name</label>
                        <input class="form-control" th:field="*{name}" type="text"/>
                    </div>
                    <div class="form-group">
                        <label class="control-label" th:for="foundedIn">Founded in</label>
                        <input class="form-control" th:field="*{foundedIn}" type="number" step="1"/>
                    </div>
                    <div class="form-group">
                        <label class="control-label" th:for="population">Population</label>
                        <input class="form-control" th:field="*{population}" type="number" step="1" min="0"/>
                    </div>
                    <div class="form-group submit-cancel">
                        <input class="btn btn-primary" type="submit" value="Save changes"/>
                        <a class="btn btn-default btn-cancel" th:href="@{/cities}">Cancel</a>
                    </div>
                </form>
            </th:block>
        </div>
    </div>
</th:block>
</html>